export const transToTree = (arr, raw) => {
  const newArr = []
  arr.forEach(item => {
    if (item.parent_id === raw) {
      const children = transToTree(arr, item.id)
      if (children.length) {
        item.children = children
      }
      newArr.push(item)
    }
  })
  return newArr
}
